package fi.bluepill.osm;


import org.openstreetmap.osmosis.core.pipeline.common.TaskConfiguration;
import org.openstreetmap.osmosis.core.pipeline.common.TaskManager;
import org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory;
import org.openstreetmap.osmosis.core.pipeline.v0_6.SinkManager;

public class MyTaskFactory extends TaskManagerFactory {
    @Override
    protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfiguration) {
        LocationImportPlugin task = new LocationImportPlugin();

        task.setCollection(getStringArgument(taskConfiguration, "collection"));
        task.setMongoURI(getStringArgument(taskConfiguration, "mongoURI"));

        return new SinkManager(taskConfiguration.getId(), task, taskConfiguration.getPipeArgs());
    }
}
